<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>订单详情</title>
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">     
	<meta content="yes" name="apple-mobile-web-app-capable">     
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection">
	<link rel="shortcut icon" href="/favicon.ico">
	<link rel="stylesheet" href="/H5/css/sm.min.css">
	<link rel="stylesheet" href="/H5/css/reset.css">
	<link rel="stylesheet" href="/H5/css/order.css?v=11">
</head>    
<body>
		<div class="page-group ms-controller" :controller="orderDteial">
	        <div class="page page-current">
	            <header class="bar bar-nav">
	              	<a class="icon icon-left pull-left" href="javascript:window.history.go(-1);"></a>
	              	<a class="icon icon-home pull-right" href="/H5"></a>
	              	<h1 class="title">订单详情</h1>
	            </header>
	            <div class="content visibility">
					<div class="address">
					    <a class="address_a">
					    	<dl>
					        	<dt>{{@data.address.name+" "+@data.address.mobile_secure}}</dt>
					        	<dd>
					            	<div>{{@data.address.area_label+" "+@data.address.address}}</div>
					            </dd>
					        </dl>
					    </a>
					</div>
		            <div class="card card_first card_first01">
    	                <div style="padding: .5rem .75rem;">订单号：{{@data.order_no}}</div>
		                <div class="card-content" :for="el in @data.goods" style="border-bottom: 2px solid #fff">
    						<div class="card-content-inner" :on-click="@to(el.goods_id)">
    	                    	<a><img :attr="{'src':el.list_cover}"/></a>
    	                        <div class="order_right" >
    	                        	<p>{{el.title}}</p>
    	                            <h5>{{el.intro||""}}</h5>
    	                            <div class="jifen"><span :visible="el.give_point>0" style="color: #4cd964; border-color: #4cd964;">赠送积分+{{el.give_point||0}}</span><span :visible="el.deviation_point>0">抵扣积分-{{el.deviation_point||0}}</span><span :visible="el.contribution>0" style="color: #4cd964; border-color: #4cd964;">贡献+{{el.contribution}}</span></div>
    	                        </div>
    	                    </div>
							<ul class="address_ul">
								<li style="font-size: .7rem;line-height: 30px;height: 30px;">商品规格<span>{{el.spec_list}}</span></li>
								<li style="font-size: .7rem;line-height: 30px;height: 30px;">商品单价<span>￥{{el.is_rebuy?el.vip_price:el.sell_price||""}}</span></li>
			                    <li style="font-size: .7rem;line-height: 30px;height: 30px;">购买数量<span>{{el.buy_num}}</span></li>
			                </ul>
		                </div>
		                <ul class="address_ul" :css="{'padding-bottom':data.order_status==0?'80px':0}">
		                    <li>运费<span>￥{{@data.postage||""}}</span></li>
                            <li style="text-align: center;font-size: .8rem;"><a href="/H5/logistics" style="color:red;">物流信息</a></li>
		                    <li :visible="@data.give_point>0">赠送总积分<span style="color: #4cd964">+{{@data.give_point||""}}</span></li>
		                    <li :visible="@data.order_contribution>0">总贡献<span style="color: #4cd964">+{{@data.order_contribution||""}}</span></li>
		                    <li :visible="@data.deviation_point>0">总抵扣积分<span>-{{@data.deviation_point||""}}</span></li>
		                    <li :visible="@data.friend_fee_money>0&&@data.is_invite>0">代付收益<span>-{{@data.friend_fee_money||""}}</span></li>
		                    <li>商品总价<span>￥{{@data.total_money}}</span></li>
		                    <li :visible="@data.use_red_packets>0">红包抵扣<span>￥{{"- "+@data.use_red_packets}}</span></li>
		                    <li>实际支付<span>￥{{@data.pay_money}}</span></li>
		                    <li :visible="@data.is_invite>0">
		                    	{{@data.is_my_invite==0?'邀请人手机号码':'代付人手机号码'}}
		                        <span :visible="@data.is_my_invite==1" style="color: #999">
		                            {{@data.friend_mobile}}
		                        </span>
		                        <span :visible="@data.is_my_invite==0" style="color: #999">
		                            {{@data.order_owner_mobile}}
		                        </span>
		                    </li>
		                    <li :visible="@data.is_invite>0">
		                    	{{@data.is_my_invite==0?'邀请人':'代付人'}}
		                        <span :visible="@data.is_my_invite==1" style="color: #999">
		                            {{@data.friend_name}}
		                        </span>
		                        <span :visible="@data.is_my_invite==0" style="color: #999">
		                            {{@data.order_owner}}
		                        </span>
		                    </li>
		                    <li>下单时间<span style="color: black">{{@data.create_time}}</span></li>
		                    <li :visible="@data.pay_time">支付时间<span style="color: black">{{@data.pay_time}}</span></li>
	                    </ul>
						<ul class="address_ul" :if="@data.order_status>=2">
							<li>发货时间<span style="color: black">{{@data.express_time||""}}</span></li>
							<li>快递<span style="color: black">{{@data.express_company||""}}</span></li>
							<li>快递单号<span style="color: black">{{@data.express_no||""}}</span></li>
	                    </ul>
						<div :visible="(@data.order_status==0&&@data.is_my_invite==0)||(@data.order_status==0&&@data.is_invite==0)" class="yess">
		                    <a href="javascript:;" style="width: 100%;" :on-click="@payMoney">立即支付</a>
		    			</div>
					</div> 
	            </div>
	        </div>
	    </div>
	<script type='text/javascript' src='/H5/js/zepto.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='/H5/js/sm.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='/H5/js/avalon.js' charset='utf-8'></script>
	<script type='text/javascript' src='/H5/js/simpleStorage.js' charset='utf-8'></script>
	<script type='text/javascript' src='/H5/js/mall.js?v=10' charset='utf-8'></script>
    <script>
		var orderDteial = avalon.define({
		    $id: "orderDteial",
		    data: {goods:{picture_urls:[]},address:{}},
		    orderId: Mall.parseUrl(window.location.href).orderId,
    	    getOrderDetail: function(){
    	    	Mall.request( "/api/OrderDetail", {order_no: orderDteial.orderId} )
    	    		.always( function( data ){
    	    			if( data.error_code == 0 ){
    	    				orderDteial.data = data.data;
    	    			}
    	    			$( ".content" ).removeClass( "visibility" );
    	    		} )
    	    },
    	    to: function( id ){
    	    	window.location.href="/H5/detail?id="+id;
    	    },
    	    payMoney: function(){
    	    	window.location.href="/H5/pay?orderId="+orderDteial.orderId;
    	    }
		})
		orderDteial.getOrderDetail();
		avalon.scan( document.body );
    </script>
</body>
</html>
